<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>工单审核</title>		
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript">
	document.onkeydown = function(event) {
		var e = event || window.event || arguments.callee.caller.arguments[0];
		if (e && e.keyCode == 13) { // enter 键
			try {
				searchData();
			} catch (e) {
				gotoSearch($('#easyui-treegrid'));
			}
		}
	};
</script>
<style type="text/css">
.imgsw {
	background: url(../resource/images/a0133.png) no-repeat;
	height: 14px;
	width: 17px;
	display: inline-block;
	border: 0;
}
</style>
<script type="text/javascript">
		var queryParams;
		function EasyuiDatagrid(){
			$("#easyui-datagrid").datagrid({
				url: '/cbweb/workorder/orderreview.html',
				nowrap: true,
				striped: true,
				border: false,
				fit: true,
				rownumbers:true,
				queryParams: getGueryParams(),
				columns: [[
					{field:'id',checkbox:true },
					{field:'type',title:'工单业务分类',align:'center'},
					{field:'title',title:'工单标题',align:'center',width:100},
					{field:'adduser',title:'工单发起人',align:'center',width:100},
					{field:'addtime',title:'工单发起时间 ',align:'center',width:150,
						formatter:function(value,row,index){
						return new Date(value).Format("yyyy-MM-dd hh:mm:ss");
					}},
					{field:'updatetime',title:'工单修改时间 ',align:'center',width:150,
						formatter:function(value,row,index){
							if(value){return new Date(value).Format("yyyy-MM-dd hh:mm:ss");}
							else {return ''}
					}},
					{field:'areaName',title:'地区',align:'center',width:100},
					{field:'status',title:'状态',align:'center',formatter:function(value,row,index){
						if(value == "1" || value == "4"){
							return "发布";
						}else{
							return "其他";
						}
					}},
					{field:'_parentId',title:'操作',align:'center',width:120,
						formatter:function(value,row,index){
					    	str= '<a id="" class="easyui-linkbutton l-btn l-btn-plain" plain="true" iconcls="icon-ok" href="javascript:void(0);" onclick="review(\''+row.id+'\',\''+row.workordertype+'\');"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">开始处理</span></span></a>';
					    	return str;
				    	}
					}
				
				]],
				singleSelect:true,
				pagination: true,
		//		view: detailview,
				pageList: [10,20,30,40,50],
				pageSize:10,
				toolbar: '#toolbar',
			//	detailFormatter:function(index,row){
		//			return '<div class="ddv" style="padding:5px 0">111111</div>';
			//	},
				onExpandRow: function(index,row){
				
				},
				onSelect: function(rowIndex,rowData) {
					
				},
				onUnselect: function(rowIndex,rowData) {
					
				},
				onCheckAll: function(rowIndex,rowData) {
					
				},
				onUncheckAll: function(rowIndex,rowData) {
				
				},
				onLoadSuccess: function (data) {
					
					if(data.total==-1) {
						$.messager.defaults={ok:"确定",cancel:"取消"};
						$.messager.confirm('提示', '用户尚未登录,请登录', function(r){
						if (r){
						    window.parent.location.href='/cbweb';
						    return false;
							}});
					}
					}
			});
	    }
		
		function endOfSubmit(){
			closeDialog($("#dialogMoveBusiness"));
			closeDialog($("#dialogMenuEdit"));
			gotoSearch();
		}
		function getGueryParams(){
			return {
				areacode:$("#areacode").val(),
				projectname:$("#projectname").val()
			};
		}
		$(function(){
			new EasyuiDatagrid();
			gotoSearch = function(){
				$("#easyui-datagrid").datagrid('reload',getGueryParams());
			};
		});
		function SubgridTabOnSelect(title,index){
			setTimeout(function(){
				$("#easyui-datagrid").datagrid('fixDetailRowHeight',index);
			},300);
			setTimeout(function(){
				$("#easyui-datagrid").datagrid('fixDetailRowHeight',index);
			},3000);
	    }
	 
		
		function load(){
			$(".datagrid-row-expander datagrid-row-expand").attr("display","none"); 
		}
		
		function _resert(){
			$("#search_shi_id").val("");
			
			$("#search_qu_id").empty();
			$("#search_qu_id").append("<option value=\"\">请选择</option>");
			$("#areacode").val("");
			$("#projectname").val("");
			
		}
		
		function onpress(){
		var event=arguments.callee.caller.arguments[0]||window.event;//消除浏览器差异
   		  	if (event.keyCode == 13){  
      			gotoSearch($('#easyui-treegrid'));
    		}
		}
		
		function add() {
			openDialog($("#dlg"),'/cbweb/system/useradd.html');
		}
		
		function edit(){
			if($('#easyui-datagrid').datagrid('getSelected')==null){
				alert("请先选择一条数据");
				return false;
			}
			var row = $('#easyui-datagrid').datagrid('getSelected').id;
			openDialog($("#dlg"),'/cbweb/system/editindex.html?id='+row);
		}

		function review(obj,obj2){
			if(obj=='null'){
				obj=0
			}
			openDialog($("#dlg"),'/cbweb/workorder/review.html?id='+obj+'&workordertype='+obj2);
		}
		
		$(function(){
			$("#search_shi_id").change(function(){
				$("#search_qu_id").empty();
				$("#search_qu_id").append("<option value=\"\">请选择</option>");
				var val = this.value;
				if(val==""){
					$("#areacode").val("");
				}else{
					$("#areacode").val(val);
				}
				if(val != ""){
					$.getJSON("/cbweb/area/sonArea.html",{code:val},function(result){
						$(result.object).each(function(){
							$("#search_qu_id").append("<option value=\""+this.code+"\">"+this.name+"</option>");
						});
					});
				}
			});
			$("#search_qu_id").change(function(){
				var val = this.value;
				if(val==""){
					val =$("#search_shi_id").val();
				}
				$("#areacode").val(val);
			});
		});
		
	</script>
	
  </head>
  <body onload="load();">
	<table id="easyui-datagrid"  title="工单审核"></table>
	<div id="toolbar" class="easyui_datagrid_toolbar"  style="" >

		<div class="easyuiSearch">
			<form onsubmit="return false;" method="post">
		<table  cellspacing="0" cellpadding="0" width="90%">
			<tr>
				 <td align="right" width="15%">地区：</td>
				  <td align="left">	<select name="shenId" id="search_shen_id"  style="width: 85px;" onkeydown="onpress();">
							<option value="">浙江省</option>
							</select>
		

						<select name="shiId" id="search_shi_id"  style="width: 85px;" onkeydown="onpress();">
							<option value="">请选择</option>
								
								<option value="3301">杭州市</option>
								
								<option value="3302">宁波市</option>
								
								<option value="3303">温州市</option>
								
								<option value="3304">嘉兴市</option>
								
								<option value="3305">湖州市</option>
								
								<option value="3306">绍兴市</option>
								
								<option value="3307">金华市</option>
								
								<option value="3308">衢州市</option>
								
								<option value="3309">舟山市</option>
								
								<option value="3310">台州市</option>
								
								<option value="3311">丽水市</option>
								
						</select>
						
						<select name="quId" id="search_qu_id"  style="width: 85px;" onkeydown="onpress();">
							<option value="">请选择</option>
								
						</select></td>
						<input name="areacode" id="areacode" type = "hidden"   onkeydown="onpress();"/>
				<td align="right" width="15%">项目名称：</td>
				 <td align="left" width="35%"><input name="projectname" id="projectname" style="width: 150px;" onkeydown="onpress();"/></td>
			</tr>
		<tr> 
		<td colspan="4" align="center">
				<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search', plain:true" onclick="gotoSearch($('#easyui-datagrid'))">查询</a>
			<!--	<a href="javascript:void(0);" class="easyui-linkbutton" data-options=" plain:true" onclick="_resert()">重置</a>-->
			</td>
			</tr>
			</table>
			</form>
		</div>
		
	</div>

	
	   <div id="dlg" class="easyui-dialog" style="width:900px;height:500px;padding-top: 0px;"
    	 data-options="title: '工单审核', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
   		<iframe scrolling="auto" frameborder="0" style="width:100%;height:99%;"></iframe>
    </div>
<!--    <div id="dlg_buttons" style="display: none;text-align: center;">-->
<!--		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="openurl_selectchannelID()">打开</a>-->
<!--        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>-->
<!--    </div>-->
    
    
  </body >
</html>